package cn.virens.common.project.generator.database.utils;


import cn.virens.common.util.exception.APIException;

import java.io.Serializable;

@SuppressWarnings("serial")
public class PathBuilder implements Serializable {
    private final StringBuilder builder;

    public PathBuilder(String rootPath) throws APIException {
        this.builder = new StringBuilder(rootPath);
    }

    public PathBuilder append(String str) throws APIException {
        builder.append("/").append(PathUtil.path(str));

        return this;
    }

    public String toString(String str) throws APIException {
        return builder.toString() + str;
    }

    @Override
    public String toString() throws APIException {
        return builder.toString();
    }

}
